package de.slothsoft.commons.res;

import java.net.URL;
import java.util.TreeMap;

import javax.swing.ImageIcon;

@SuppressWarnings("nls")
public class CommonImages {

    private static java.util.Map<String, ImageIcon> images = new TreeMap<>();

    public static ImageIcon get(String imageName) {
	if (imageName == null)
	    return null;

	ImageIcon icon = images.get(imageName);

	if (icon == null) {
	    URL url = CommonImages.class.getResource(imageName);//$NON-NLS-1$
	    if (url == null)
		return null;
	    icon = new ImageIcon(url);
	    images.put(imageName, icon);
	}

	return icon;
    }

    /*
     * 
     */

    public static final String TOOLBAR_OPEN = "toolbar_open.png";
}
